home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Divers / DinkClass ƒ / DinkClass / DScrollWindow.h < prev    next >
Encoding:
Text File  |  1992-12-31  |  3.1 KB  |  119 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        DScrollWindow.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Mark Gross
  7.  
  8.     Copyright:    © 1992 by Applied Technical Software, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>    12/31/92    MTG        making the code conditionaly compiled so         that I am
  13.                                     always working with a current         version in either think c
  14.                                     or MPW C++
  15.          <2>    11/14/92    MTG        Bringing the C++ version up to date WRT the         ThinkC
  16.                                     version.
  17.  
  18.     To Do:
  19. */
  20.  
  21.  
  22. // This is the implementation of TScrollDoc subclass in my 
  23. // class library.  
  24.  
  25. #ifndef __DSCROLLWINDOW__
  26. #define __DSCROLLWINDOW__
  27.  
  28. #include "DWindow.h"
  29.  
  30.  
  31. class DScrollWindow : public DWindow
  32. {
  33. protected:
  34.  
  35.     short            fVMin;
  36.     short            fVMax;
  37.     
  38.     short            fHMin;
  39.     short            fHMax;
  40.         // these Max and Min's are the extreams of all that (the bounds of visibility)
  41.         // is visable by working the scroll bar control.  This is not the
  42.         // same as the ranges used in the scroll bar controls (fHMax will
  43.         // be bigger than the fHorizScrollBar MaxValue by the number 
  44.         // of pixles across the content rect for most scrollbar applications)
  45.     
  46.     ControlHandle    fHorizScrollBar;
  47.     ControlHandle    fVertScrollBar;
  48.  
  49. public:
  50.     DScrollWindow(void);
  51.     ~DScrollWindow(void);
  52.         
  53.         //DWindow OverRides
  54.     virtual Boolean    Init(DDocument *doc, Boolean hasColorWindows);
  55.  
  56.     virtual Boolean     KillMeNext(void);
  57.     virtual    void    HandleUpdateEvt(EventRecord *theEvent);
  58.     virtual void     HandleActivateEvt(EventRecord *theEvent);
  59.     virtual void     HandleOSEvent(EventRecord *theEvent);
  60.         // needed to hide the scroll bars when a context switch happens 
  61.     
  62.         //New To DScrollWindow
  63.     virtual    short    GetVertLineScrollAmount(void);
  64.     virtual    short    GetHorizLineScrollAmount(void);
  65.     
  66.     virtual    short    GetVertPageScrollAmount(void);
  67.     virtual    short    GetHorizPageScrollAmount(void);
  68.     
  69. protected:
  70.  
  71.         //DWindow OverRides
  72.     virtual    void    DoGrow(EventRecord *theEvent);
  73.     virtual    void    DoZoom(short partCode);
  74.     virtual    void    DoContent(EventRecord *theEvent);
  75.  
  76.         //New To DScrollWindow
  77.     
  78.     void    SizeScrollBars(void);
  79.  
  80. public:
  81.  
  82.     void    ValidateScrollRange(void);
  83.             // Call whenever possible scroll range or window size change.
  84.             
  85.     void    ValidateVertScrollRange(void);
  86.             // Call for small changes common in TextEdit type applications
  87.             // which only need to wory about the vertical changes to the
  88.             // scroll parameters, Like when some text is added/deleted
  89.             // from a document.
  90.  
  91.     void    SynchScrollBars(void);
  92.             // validate ranges and set thumb setting correctly
  93.     
  94. protected:
  95.  
  96.     void    ScrollClick(EventRecord *theEvent);
  97.     void    DoThumbScroll(ControlHandle theControl, Point localPt);
  98.     void    DoPageScroll(ControlHandle theControl, short part);
  99.     void    DoButtonScroll(ControlHandle theControl, Point localPt);
  100.     
  101.     virtual void    ScrollContents(short dh, short dv);
  102.             // The scroll operation bottelneck procedure for doing
  103.             // the scroll.  It pressently implements the scrolling
  104.             // common for image types of applications. (TE apps will 
  105.             // need to override this)
  106.  
  107. public:
  108.     
  109.     void    DoHScroll(short change);
  110.     void    DoVScroll(short change);
  111.     
  112.     static pascal void ActionProc(ControlHandle theControl, short partCont);
  113.     
  114. };// end of class declaration for TDocRootd
  115.  
  116.     
  117.  
  118.  
  119. #endif __DSCROLLWINDOW__